home *** CD-ROM | disk | FTP | other *** search
/ The Trig Explorer / The Trig Explorer.iso / mac / Explorer / START.dxr / 00026_Open Lessons.ls < prev    next >
Encoding:
Text File  |  1998-07-22  |  913 b   |  43 lines

  1. on closeLesson
  2.   global isLesson
  3.   if isLesson then
  4.     forget(window "Lesson")
  5.     updateStage()
  6.     set isLesson to 0
  7.     delay(60)
  8.   end if
  9. end
  10.  
  11. on openLesson name
  12.   global isLesson
  13.   updateStage()
  14.   closeLesson()
  15.   set isLesson to 1
  16.   set horzOrigin to the stageLeft + 120
  17.   set vertOrigin to the stageTop
  18.   set LessonRect to rect(horzOrigin, vertOrigin, horzOrigin + 520, vertOrigin + 446)
  19.   if name = "Plot" then
  20.     set LessonRect to rect(the stageLeft, the stageTop, the stageRight, the stageBottom)
  21.   end if
  22.   set Lesson to window "Lesson"
  23.   set the rect of Lesson to LessonRect
  24.   set the fileName of Lesson to name
  25.   set the windowType of Lesson to 2
  26.   set the titleVisible of Lesson to 0
  27.   open(Lesson)
  28. end
  29.  
  30. on hideLesson
  31.   global isLesson
  32.   if isLesson then
  33.     moveToBack(window "Lesson")
  34.   end if
  35. end
  36.  
  37. on showLesson
  38.   global isLesson
  39.   if isLesson then
  40.     moveToFront(window "Lesson")
  41.   end if
  42. end
  43.